package com.pearadmin.hospital.service.impl;

import java.util.List;
import java.util.ArrayList;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pearadmin.common.web.domain.request.PageDomain;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.pearadmin.hospital.mapper.HospitalReturngoodsMapper;
import com.pearadmin.hospital.domain.HospitalReturngoods;
import com.pearadmin.hospital.service.IHospitalReturngoodsService;

/**
 * 收到退货Service业务层处理
 * 
 * @author yuan
 * @date 2021-07-29
 */
@Service
public class HospitalReturngoodsServiceImpl implements IHospitalReturngoodsService 
{
    @Autowired
    private HospitalReturngoodsMapper hospitalReturngoodsMapper;

    /**
     * 查询收到退货
     * 
     * @param id 收到退货ID
     * @return 收到退货
     */
    @Override
    public HospitalReturngoods selectHospitalReturngoodsById(Integer id)
    {
        return hospitalReturngoodsMapper.selectHospitalReturngoodsById(id);
    }

    /**
     * 查询收到退货列表
     * 
     * @param hospitalReturngoods 收到退货
     * @return 收到退货
     */
    @Override
    public List<HospitalReturngoods> selectHospitalReturngoodsList(HospitalReturngoods hospitalReturngoods)
    {
        return hospitalReturngoodsMapper.selectHospitalReturngoodsList(hospitalReturngoods);
    }

    /**
     * 查询收到退货
     * @param hospitalReturngoods 收到退货
     * @param pageDomain
     * @return 收到退货 分页集合
     * */
    @Override
    public PageInfo<HospitalReturngoods> selectHospitalReturngoodsPage(HospitalReturngoods hospitalReturngoods, PageDomain pageDomain)
    {
        PageHelper.startPage(pageDomain.getPage(),pageDomain.getLimit());
        List<HospitalReturngoods> data = hospitalReturngoodsMapper.selectHospitalReturngoodsList(hospitalReturngoods);
        return new PageInfo<>(data);
    }

    /**
     * 新增收到退货
     * 
     * @param hospitalReturngoods 收到退货
     * @return 结果
     */

    @Override
    public int insertHospitalReturngoods(HospitalReturngoods hospitalReturngoods)
    {
        return hospitalReturngoodsMapper.insertHospitalReturngoods(hospitalReturngoods);
    }

    /**
     * 修改收到退货
     * 
     * @param hospitalReturngoods 收到退货
     * @return 结果
     */
    @Override
    public int updateHospitalReturngoods(HospitalReturngoods hospitalReturngoods)
    {
        return hospitalReturngoodsMapper.updateHospitalReturngoods(hospitalReturngoods);
    }

    /**
     * 删除收到退货对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteHospitalReturngoodsByIds(String[] ids)
    {
        return hospitalReturngoodsMapper.deleteHospitalReturngoodsByIds(ids);
    }

    /**
     * 删除收到退货信息
     * 
     * @param id 收到退货ID
     * @return 结果
     */
    @Override
    public int deleteHospitalReturngoodsById(Integer id)
    {
        return hospitalReturngoodsMapper.deleteHospitalReturngoodsById(id);
    }
}
